package com.intct.hbase.dml.impl;

import com.intct.hbase.dml.AbsDMLSerivce;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Table;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025-09-29 15:38
 */
public class DeleteData extends AbsDMLSerivce {
    @Override
    public void execCommand(Table table) {
        /**
         * api没有deleteall，如果使用列族、列限定符，就是删除所有版本
         */
        Delete delete = new Delete("1001".getBytes());
        delete.addColumn("f1".getBytes(), "id".getBytes());
        try {
            table.delete(delete);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws IOException {
        new DeleteData().start("intct85", "t3");
    }
}
